﻿using System.Collections.Generic;
using System.Reflection;

namespace IInject.Resolution
{
	public abstract class Dependency<TChild> : IDependency<TChild> where TChild : IDependency
	{
		protected Dependency(DependencyType dependencyType)
		{
			DependencyType = dependencyType;
			Dependencies = new List<TChild>();
		}

		public DependencyType DependencyType { get; private set; }

		public IList<TChild> Dependencies { get; private set; }
	}

	public abstract class Dependency<TMember, TChild> : Dependency<TChild>, IDependency<TMember, TChild> where TMember : MemberInfo where TChild : IDependency
	{
		protected Dependency(DependencyType dependencyType) : base(dependencyType)
		{
		}

		public TMember Dependent { get; set; }
	}
}
